<extend name="public:base" />

<block name="left">
	<div class="mark_bar cl">
		<a href="{:url('uc/bank/index')}" class="goback fl"><i class="iconfont">&#xe600;</i></a>
		<p>验证已绑银行卡信息</p>
		<a href="{:url('index/rules/apply')}" class="btm"><span class="af60">申请人工更换</span></a>
	</div>
</block>

<block name="main">
	<div class="content">
		<div class="center_link_list">
			<ul>
				<li>
					<a href="javascript:movetop('banklist_info');">
						<span class="small">资金同卡进出，请绑定您的常用卡</span>
						<i class="iconfont arrow_r">&#xe611;</i>
						<i class="fr small">查看银行限额</i>
						<div class="cl"></div>
					</a>
				</li>
			</ul>
		</div>
		<form action="{:url('uc/bank/replace')}" method="post" id="form">
			<input type="hidden" name="type" value="2" />
			<div class="bind_card from">
				<div class="input_form">
					<div class="input_form_bar">
						<p class="fl">原银行卡号</p>
						<input type="number" id="card_id" name="card_id" placeholder="请输入原储蓄卡卡号" autocomplete="off" />
						<div class="cl"></div>
					</div>
					<div class="input_form_bar">
						<p style="white-space: nowrap;">短信验证码</p>
						<input name="scode" id="scode" class="input_t" value="" size="6" maxlength="6" placeholder="请输入短信验证码" autocomplete="off" type="number" />
						<a href="javascript:void(0);" class="send_btm" id="btnSendMsg">获取验证码</a>
						<div class="cl"></div>
					</div>
				</div>

				<div class="wrap">
					<button class="submit nor" type="submit">下一步</button>
				</div>
			</div>
		</form>

		<div id="banklist_info" class="openframe hide">
			<div class="mark_bar invest_mark_bar">
				<a href="javascript:;" onclick="movebot('banklist_info');" class="goback fl"><i class="iconfont">&#xe602;</i></a>
				<p>查看各支持银行充值限额</p>
			</div>
			<div class="openframe_content">
				<p class="red small">提示：新卡首笔充值2个自然日后为老卡（24小时为一个自然日）</p>
				<ul class="banklist pt05">
					<volist name="banklist" id="v">
						<li>
							<img src="__IMG__/old_banklogo/{$v.bank_code}.png" />
							<p>
								<span class="blue">{$v.bank_name}</span><br />
								<span class="a999 small">{$v.card_limit}</span>
							</p>
							<div class="cl"></div>
						</li>
					</volist>
				</ul>
			</div>
		</div>
	</div>

</block>

<block name="menu"></block>

<block name="js">
	<script type="text/javascript" src="__JS__/check.js?v={:config('app_ver')}"></script>
	<script type="text/javascript">
        // 短信验证码倒计时
        function settTimes() {
            var intTime = 59;  //秒数
            var beginTime;
            beginTime = setInterval(function () {
                var o = $("#btnSendMsg");
                if (intTime === 0) {
                    clearInterval(beginTime);
                    o.removeClass('dis');
                    o.html('获取验证码');
                    intTime = 59;
                } else {
                    o.addClass('dis');
                    o.html(intTime + "s后重新发送");
                    intTime--;
                }
            }, 1000);
        }

		$("#btnSendMsg").click(function () {
		    var _this = $(this);
		    if( _this.is(".dis")) return false;
            if(!checkBankcard()) return false;
            $.ajax({
                url: "{:url('uc/bank/replace')}",
                type: "post",
                dataType: "json",
                data: {card_id: $("#card_id").val(),type:1},
                success: function (d) {
                    leftsecond = 60;
                    wjtips(d.msg);
                    _this.removeClass("dis");
                    if (d.code == 1) {
                        settTimes();
                    } else {
                        _this.html("获取验证码");
                    }
                }
            });
        });


        //验证提交
        $('#form').submit(function() {
            if(!checkBankcard()) return false;
            if(!checkPhonecode()) return false;
            return ajax_post($(this));
        });

	</script>
</block>